package com.example.kugou.controller;

import com.example.kugou.pojo.MvType;
import com.example.kugou.service.MvTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/mvType")
@Api(tags = "MV类型相关接口",description = "提供MV类型相关的Rest API")
public class MvTypeController {

    @Resource
    MvTypeService mvTypeService;

    public MvTypeService getMvTypeService() {
        return mvTypeService;
    }

    public void setMvTypeService(MvTypeService mvTypeService) {
        this.mvTypeService = mvTypeService;
    }

    @GetMapping("/selectAllType")
    @ApiOperation("查询全部的视频文件的类型")
    public Map<String,Object> selectAllType() {
        List<MvType> mvTypes = mvTypeService.selectAllType();
        Map<String,Object> map = new HashMap<>();
        map.put("mvTypes" ,mvTypes);
        return map;
    }
}
